import request from '@/utils/request'
import { GEN_SERVER } from '@/config/baseUrl'

// 查询ERP配方数据列表
export function listErpFormula(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpFormula/list',
    method: 'post',
    data: data
  })
}

// 查询ERP配方数据详细
export function getErpFormula(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpFormula/detail',
    method: 'get',
    params: {
        id
    }
  })
}

// 新增/修改ERP配方数据
export function addOrUpdateErpFormula(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpFormula/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除ERP配方数据
export function delErpFormula(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpFormula/deleteByIds',
    method: 'post',
    params: {
      ids: id
    }
  })
}

// 导出ERP配方数据
export function exportErpFormula(query) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpFormula/export',
    method: 'post',
    data: query
  })
}
